using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Distance._Legacy
{
    /// <summary>
    /// <para>Euclidean Direction</para>
    /// <para>Calculates, for each cell, the direction, in degrees, to the nearest source.</para>
    /// <para>计算每个像元到最近源的方向（以度为单位）。</para>
    /// </summary>    
    [DisplayName("Euclidean Direction")]
    public class EucDirection : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EucDirection()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_source_data">
        /// <para>Input raster or feature source data</para>
        /// <para><xdoc>
        ///   <para>The input source locations.</para>
        ///   <para>This is a raster or feature dataset that identifies the cells or locations to which the Euclidean distance for every output cell location is calculated.</para>
        ///   <para>For rasters, the input type can be integer or floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入源位置。</para>
        ///   <para>这是一个栅格或要素数据集，用于标识计算每个输出像元位置的欧几里得距离的像元或位置。</para>
        ///   <para>对于栅格，输入类型可以是整数或浮点。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_direction_raster">
        /// <para>Output direction raster</para>
        /// <para><xdoc>
        ///   <para>The output Euclidean direction raster.</para>
        ///   <para>The direction raster contains the calculated direction, in degrees, that each cell center is from the closest source cell center.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        ///   <para>The output raster is of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出欧几里得方向栅格。</para>
        ///   <para>方向栅格包含计算出的方向（以度为单位），每个像元中心都来自最近的源像元中心。</para>
        ///   <para>值的范围为 0 度到 360 度，其中 0 保留给源像元。正东（右）为 90，值顺时针递增（180 为南，270 为西，360 为北）。</para>
        ///   <para>输出栅格为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        public EucDirection(object _in_source_data, object _out_direction_raster)
        {
            this._in_source_data = _in_source_data;
            this._out_direction_raster = _out_direction_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Euclidean Direction";

        public override string CallName => "sa.EucDirection";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_source_data, _out_direction_raster, _maximum_distance, _cell_size, _out_distance_raster, _distance_method.GetGPValue(), _in_barrier_data, _out_back_direction_raster];

        /// <summary>
        /// <para>Input raster or feature source data</para>
        /// <para><xdoc>
        ///   <para>The input source locations.</para>
        ///   <para>This is a raster or feature dataset that identifies the cells or locations to which the Euclidean distance for every output cell location is calculated.</para>
        ///   <para>For rasters, the input type can be integer or floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入源位置。</para>
        ///   <para>这是一个栅格或要素数据集，用于标识计算每个输出像元位置的欧几里得距离的像元或位置。</para>
        ///   <para>对于栅格，输入类型可以是整数或浮点。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature source data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_source_data { get; set; }


        /// <summary>
        /// <para>Output direction raster</para>
        /// <para><xdoc>
        ///   <para>The output Euclidean direction raster.</para>
        ///   <para>The direction raster contains the calculated direction, in degrees, that each cell center is from the closest source cell center.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        ///   <para>The output raster is of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出欧几里得方向栅格。</para>
        ///   <para>方向栅格包含计算出的方向（以度为单位），每个像元中心都来自最近的源像元中心。</para>
        ///   <para>值的范围为 0 度到 360 度，其中 0 保留给源像元。正东（右）为 90，值顺时针递增（180 为南，270 为西，360 为北）。</para>
        ///   <para>输出栅格为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_direction_raster { get; set; }


        /// <summary>
        /// <para>Maximum distance</para>
        /// <para><xdoc>
        ///   <para>The threshold that the accumulative distance values cannot exceed.</para>
        ///   <para>If an accumulative Euclidean distance value exceeds this value, the output value for the cell location will be NoData.</para>
        ///   <para>The default distance is to the edge of the output raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>累积距离值不能超过的阈值。</para>
        ///   <para>如果累积欧几里得距离值超过此值，则像元位置的输出值将为 NoData。</para>
        ///   <para>默认距离为到输出栅格的边缘。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _maximum_distance { get; set; } = null;


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Output distance raster</para>
        /// <para><xdoc>
        ///   <para>The output Euclidean distance raster.</para>
        ///   <para>The distance raster identifies, for each cell, the Euclidean distance to the closest source cell, set of source cells, or source location.</para>
        ///   <para>The output raster is of floating-point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出欧几里得距离栅格。</para>
        ///   <para>距离栅格用于标识每个像元到最近源像元、源像元集或源位置的欧几里得距离。</para>
        ///   <para>输出栅格为浮点类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output distance raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_distance_raster { get; set; } = null;


        /// <summary>
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to calculate the distance using a planar (flat earth) or a geodesic (ellipsoid) method.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—The distance calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geodesic—The distance calculation will be performed on the ellipsoid. Therefore, regardless of input or output projection, the results do not change.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是使用平面（平坦地球）还是测地线（椭球体）方法计算距离。</para>
        ///   <bulletList>
        ///     <bullet_item>平面—将使用 2D 笛卡尔坐标系在投影平面上执行距离计算。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>测地线—将在椭球体上执行距离计算。因此，无论输入或输出投影如何，结果都不会改变。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distance_method_value _distance_method { get; set; } = _distance_method_value._PLANAR;

        public enum _distance_method_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—The distance calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.</para>
            /// <para>平面—将使用 2D 笛卡尔坐标系在投影平面上执行距离计算。这是默认设置。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic—The distance calculation will be performed on the ellipsoid. Therefore, regardless of input or output projection, the results do not change.</para>
            /// <para>测地线—将在椭球体上执行距离计算。因此，无论输入或输出投影如何，结果都不会改变。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Input raster or feature barrier data</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the barriers.</para>
        ///   <para>The barriers can be defined by an integer or a floating-point raster, or by a feature layer.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义障碍的数据集。</para>
        ///   <para>障碍可以由整数或浮点栅格或要素图层定义。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature barrier data")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_barrier_data { get; set; } = null;


        /// <summary>
        /// <para>Out back direction raster</para>
        /// <para><xdoc>
        ///   <para>The output Euclidean back direction raster.</para>
        ///   <para>The back direction raster contains the calculated direction in degrees. The direction identifies the next cell along the shortest path back to the closest source while avoiding barriers.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        ///   <para>The output raster is of type float.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出欧几里得反向栅格。</para>
        ///   <para>返回方向栅格包含以度为单位的计算方向。该方向沿最短路径识别下一个像元，同时避开障碍物。</para>
        ///   <para>值的范围为 0 度到 360 度，其中 0 保留给源像元。正东（右）为 90，值顺时针递增（180 为南，270 为西，360 为北）。</para>
        ///   <para>输出栅格的类型为浮点型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Out back direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_back_direction_raster { get; set; } = null;


        public EucDirection SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}